package models

import "gorm.io/gorm"

type Task struct {
	gorm.Model
	Uid      uint64
	Tid      string `gorm:"uniqueIndex;size:40"`
	UserName string `json:"username" form:"username" binding:"required" gorm:"size:50;not null"`
	RepoUrl  string `form:"repo_url" binding:"required"`
	Branch   string `form:"branch" binding:"required"`
	Language string `form:"language" binding:"required"`
	State    int    `gorm:"default:1"` // 0:success 1:processing 2:failed
	AbsPath  string
	Total    int
	Covered  int
	Percent  float64
}

// https://github.com/golang/go/blob/0104a31b8fbcbe52728a08867b26415d282c35d2/src/cmd/cover/profile.go#L56
//name.go:line.column,line.column numberOfStatements count
